<template>
  <div class="box">
    <p style="font-size: 30px;font-weight: 700;">分中心学生客户公海策略设置</p>
    <div style="text-align: left; margin-top: 2%">
      <el-row>
        <el-col :span="24">
          <p style=" font-size: 24px; 1%; font-weight: 700; ">总部分配客户:</p>
        </el-col>
      </el-row>
      <div style=" margin-top: 2%">
        <el-row>
          <el-col :span="6">
            <span style=" font-size: 24px; font-weight: 700;"
              >是否自动回归公海：</span
            >
          </el-col>
          <el-col :span="18">
            <el-radio v-model="auto" label="1" size="medium">是</el-radio>
            <el-radio v-model="auto" label="2" size="medium">否</el-radio>
          </el-col>
        </el-row>
      </div>
      <div class="input-box" v-if="auto == 1">
        <el-row>
          <el-col :span="6">
            <div class="tit">
              <span>自动回归期限：</span>
            </div>
          </el-col>
          <el-col :span="18">
            <div class="input-box-c">
              <el-row>
                <el-col :span="6">
                  <span class="input-box-c-tit">A类客户：</span>
                </el-col>
                <el-col :span="6">
                  <el-input v-model="aUser"></el-input>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="6">
                  <span class="input-box-c-tit">B+类客户：</span>
                </el-col>
                <el-col :span="6">
                  <el-input v-model="bUser"></el-input>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="6">
                  <span class="input-box-c-tit">B-类客户：</span>
                </el-col>
                <el-col :span="6">
                  <el-input v-model="b2User"></el-input>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="6">
                  <span class="input-box-c-tit">C类客户：</span>
                </el-col>
                <el-col :span="6">
                  <el-input v-model="cUser"></el-input>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="6">
                  <span style="margin-top:5%;display:inline-block"
                    >D类客户：</span
                  >
                </el-col>
                <el-col :span="6">
                  <el-input v-model="dUser"></el-input>
                </el-col>
              </el-row>
            </div>
          </el-col>
        </el-row>
      </div>
    </div>
    <div class="clear"></div>
    <div style="margin-top: 2%;">
      <KtButton
        :label="$t('action.close')"
        perms="true"
        type="primary"
        size="medium"
        style="margin-right: 2%;"
        @click="closeSelectedTag()"
      ></KtButton>
      <KtButton
        :label="$t('action.save')"
        perms="true"
        type="primary"
        size="medium"
        style="margin-top: 2%; "
        @click="save"
      ></KtButton>
    </div>
    <div style="text-align: left; margin-top: 2%">
      <el-row>
        <el-col :span="24">
          <p style=" font-size: 24px; font-weight: 700;">OEM卡激活客户:</p>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="7">
          <span style=" font-size: 20px;  font-weight: 700; "
            >是否自动回归公海</span
          >
        </el-col>
        <el-col :span="17">
          <el-radio-group v-model="OEM">
            <el-radio label="1">是</el-radio>
            <el-radio label="2">否</el-radio>
          </el-radio-group>
        </el-col>
      </el-row>
    </div>
    <div class="input-box" v-if="OEM == 1">
      <!-- <el-row style="margin-top:2%">
        <el-col :span="6">
          <span class="tit" style="">自动回归期限：</span>
        </el-col>
        <el-col :span="16">
          <el-row>
            <el-col :span="24">
              <el-col :span="15">
                <el-row>
                  <el-col :span="12">
                    <el-row>
                      
                      <el-col :span="14">
                        <el-input v-model="OEMdeletedIds"></el-input>
                      </el-col>
                    </el-row>
                  </el-col>
                </el-row>
                <el-row style="margin-top:5%">
                  <el-col :span="12">
                    <el-row>
                      <el-col :span="10">
                        <span style="margin-top:10%;display: inline-block;"
                          >未成单：</span
                        >
                      </el-col>
                      <el-col :span="14">
                        <el-input v-model="OEMsingle_shard"></el-input>
                      </el-col>
                    </el-row>
                  </el-col>
                </el-row>
              </el-col>
            </el-col>
          </el-row>
        </el-col>
      </el-row> -->
      <el-row style="margin-top:30px;">
        <el-col :span="6" style="text-align:left;">
          <span class="tit" style="">自动回归期限：</span>
        </el-col>
        <!-- <el-col  :span="18">
          <el-col :span="5">
            <el-input v-model="OEMdeletedIds"></el-input>
          </el-col>
        </el-col> -->
          <el-col :span="18">
            <div class="input-box-c">
              <el-row>
                <el-col :span="6">
                  <span class="input-box-c-tit">A类客户：</span>
                </el-col>
                <el-col :span="6">
                  <el-input v-model="OEMaUser"></el-input>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="6">
                  <span class="input-box-c-tit">B+类客户：</span>
                </el-col>
                <el-col :span="6">
                  <el-input v-model="OEMbUser"></el-input>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="6">
                  <span class="input-box-c-tit">B-类客户：</span>
                </el-col>
                <el-col :span="6">
                  <el-input v-model="OEMb2User"></el-input>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="6">
                  <span class="input-box-c-tit">C类客户：</span>
                </el-col>
                <el-col :span="6">
                  <el-input v-model="OEMcUser"></el-input>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="6">
                  <span style="margin-top:5%;display:inline-block"
                    >D类客户：</span
                  >
                </el-col>
                <el-col :span="6">
                  <el-input v-model="OEMdUser"></el-input>
                </el-col>
              </el-row>
            </div>
          </el-col>
      </el-row>
    </div>
    <div class="clear"></div>
    <div style="margin-top: 2%;">
      <KtButton
        :label="$t('action.close')"
        perms="true"
        type="primary"
        size="medium"
        style="margin-right: 2%;"
        @click="closeSelectedTag()"
      ></KtButton>
      <KtButton
        :label="$t('action.save')"
        perms="true"
        type="primary"
        size="medium"
        style="margin-top: 2%; "
        @click="saveOEM"
      ></KtButton>
    </div>
  </div>
</template>

<script>
import PersonalTable from "@/views/Core/PersonalTable";
import DepartmentTable from "@/views/Core/DepartmentTable";
import KtButton from "@/views/Core/KtButton";
export default {
  name: "school",
  components: {
    KtButton
  },
  data() {
    return {
      radio: "",
      OEM: "",
      auto: "",
      selectedTag: this.$route.path,
      listCustomerAutomaticAssignStrategy: [],
      deletedIds: "", //未跟进
      single_shard: "", //未成单
      OEMdeletedIds: "", //未跟进
      OEMsingle_shard: "", //未成单
      aUser: "",
      bUser: "",
      b2User: "",
      cUser: "",
      dUser: "",
      eUser: "",
      abUser: "",
      OEMaUser:"",
      OEMbUser:"",
      OEMb2User:"",
      OEMcUser:"",
      OEMdUser:"",
    };
  },
  computed: {
    visitedViews() {
      // console.log("tabView");
      // console.log(this.$store.state.tagsview);
      // console.log(this.$store.state.visitedViews);
      return this.$store.state.tagsview.visitedViews;
    }
  },
  watch: {
    visible(value) {
      if (value) {
        document.body.addEventListener("click", this.closeMenu);
      } else {
        document.body.removeEventListener("click", this.closeMenu);
      }
    }
  },
  methods: {
    getConfig() {
      // 总部分配客户
      this.$api.student
        .strategyConfigQueryConfig({
          names: "BC_AUTOWARE_RETURN_SEA_FROM_HQ",
          type: 1
        })
        .then(res => {
          this.auto = res.customerAssignConfig[0].value;
        });
      // OEM卡
      this.$api.student
        .strategyConfigQueryConfig({
          names: "BC_AUTOWARE_RETURN_SEA_FROM_OEM",
          type: 1
        })
        .then(res => {
          this.OEM = res.customerAssignConfig[0].value;
        });
      // 获取总部未跟进
      this.$api.student
        .strategyConfigQueryConfig({
          names: "BC_NOT_TRACKING_RETURN_SEA_CYCLE_FROM_HQ",
          type: 1
        })
        .then(res => {
          this.deletedIds = res.customerAssignConfig[0].value;
        });
      // 获取总部未成单
      this.$api.student
        .strategyConfigQueryConfig({
          names: "BC_NOT_SIGN_RETURN_SEA_CYCLE_FROM_HQ",
          type: 1
        })
        .then(res => {
          this.single_shard = res.customerAssignConfig[0].value;
        });
      // 获取OEM未跟进
      this.$api.student
        .strategyConfigQueryConfig({
          names: "BC_NOT_TRACKING_RETURN_SEA_CYCLE_FROM_OEM",
          type: 1
        })
        .then(res => {
          this.OEMdeletedIds = res.customerAssignConfig[0].value;
        });
      // 获取OEM未成单
      this.$api.student
        .strategyConfigQueryConfig({
          names: "BC_NOT_SIGN_RETURN_SEA_CYCLE_FROM_OEM",
          type: 1
        })
        .then(res => {
          this.OEMsingle_shard = res.customerAssignConfig[0].value;
        });
      // 获取A类客户客户自动回归期限
      this.$api.student
        .strategyConfigQueryConfig({
          names: "HQ_A_BC_CUSTOMER_AUTOWARE_RETURN_SEA_CYCLE",
          type: 1
        })
        .then(res => {
          this.aUser = res.customerAssignConfig[0].value;
        });
      // 获取B类客户客户自动回归期限
      this.$api.student
        .strategyConfigQueryConfig({
          names: "HQ_B_BC_CUSTOMER_AUTOWARE_RETURN_SEA_CYCLE",
          type: 1
        })
        .then(res => {
          this.bUser = res.customerAssignConfig[0].value;
        });
      // 获取B-类用户
      this.$api.student
        .strategyConfigQueryConfig({
          names: "HQ_B2_BC_CUSTOMER_AUTOWARE_RETURN_SEA_CYCLE",
          type: 1
        })
        .then(res => {
          this.b2User = res.customerAssignConfig[0].value;
        });
      // 获取C类客户客户自动回归期限
      this.$api.student
        .strategyConfigQueryConfig({
          names: "HQ_C_BC_CUSTOMER_AUTOWARE_RETURN_SEA_CYCLE",
          type: 1
        })
        .then(res => {
          this.cUser = res.customerAssignConfig[0].value;
        });
      // 获取D类客户客户自动回归期限
      this.$api.student
        .strategyConfigQueryConfig({
          names: "HQ_D_BC_CUSTOMER_AUTOWARE_RETURN_SEA_CYCLE",
          type: 1
        })
        .then(res => {
          this.dUser = res.customerAssignConfig[0].value;
        });
      // 获取OEM卡A类客户客户自动回归期限
      this.$api.student
        .strategyConfigQueryConfig({
          names: "BC_NOT_TRACKING_RETURN_SEA_CYCLE_FROM_OEM_A",
          type: 1
        })
        .then(res => {
          this.OEMaUser = res.customerAssignConfig[0].value;
        });
         // 获取OEM卡B+类客户客户自动回归期限
        this.$api.student
        .strategyConfigQueryConfig({
          names: "BC_NOT_TRACKING_RETURN_SEA_CYCLE_FROM_OEM_B",
          type: 1
        })
        .then(res => {
          this.OEMbUser = res.customerAssignConfig[0].value;
        });
        // 获取OEM卡B-类客户客户自动回归期限
        this.$api.student
        .strategyConfigQueryConfig({
          names: "BC_NOT_TRACKING_RETURN_SEA_CYCLE_FROM_OEM_B2",
          type: 1
        })
        .then(res => {
          this.OEMb2User = res.customerAssignConfig[0].value;
        });
        // 获取OEM卡c类客户客户自动回归期限
        this.$api.student
        .strategyConfigQueryConfig({
          names: "BC_NOT_TRACKING_RETURN_SEA_CYCLE_FROM_OEM_C",
          type: 1
        })
        .then(res => {
          this.OEMcUser = res.customerAssignConfig[0].value;
        });
         // 获取OEM卡D类客户客户自动回归期限
        this.$api.student
        .strategyConfigQueryConfig({
          names: "BC_NOT_TRACKING_RETURN_SEA_CYCLE_FROM_OEM_D",
          type: 1
        })
        .then(res => {
          this.OEMdUser = res.customerAssignConfig[0].value;
        });
      // 个人私海客户A类数量限制：
      this.$api.student
        .strategyConfigQueryConfig({
          names: "HQ_A_CUSTOMER_NUM_LIMIT",
          type: 1
        })
        .then(res => {
          this.abUser = res.customerAssignConfig[0].value;
        });
    },
    //  保存
    save() {
      let aa = [];
      let bb = [];
      let customerAssignConfigList2 = Object.assign({}, this.auto);
      let customerAssignConfigList = Object.assign({}, this.OEM);
      aa.push(customerAssignConfigList);
      bb.push(customerAssignConfigList2);
      aa.forEach(item => {
        item.value = item[0];
        item.name = "BC_AUTOWARE_RETURN_SEA_FROM_OEM";
      });
      bb.forEach(item => {
        item.value = item[0];
        item.name = "BC_AUTOWARE_RETURN_SEA_FROM_HQ";
      });
      // this.$api.student
      //   .strategyConfigSetConfig({
      //     customerAssignConfigList: aa,
      //     type: 1
      //   })
      //   .then(res => {
      //     if (res.result == 2) {
      //       this.$message({
      //         message: res.msg,
      //         type: "error"
      //       });
      //     } else {
      //       this.$message({
      //         message: res.msg,
      //         type: "success"
      //       });
      //     }
      //   });
      this.$api.student
        .strategyConfigSetConfig({
          customerAssignConfigList: bb,
          type: 1
        })
        .then(res => {
          if (res.result == 2) {
            this.$message({
              message: res.msg,
              type: "error"
            });
          } else {
            this.$message({
              message: res.msg,
              type: "success"
            });
          }
        });
      // // 设置未跟进：
      // let customerAssignConfigListA = [
      //   {
      //     name: "BC_NOT_TRACKING_RETURN_SEA_CYCLE_FROM_HQ",
      //     value: this.deletedIds
      //   }
      // ];
      // this.$api.student
      //   .strategyConfigSetConfig({
      //     customerAssignConfigList: customerAssignConfigListA,
      //     type: 1
      //   })
      //   .then(res => {
      //     if (res.result == 2) {
      //       this.$message({
      //         message: res.msg,
      //         type: "error"
      //       });
      //     } else {
      //       this.$message({
      //         message: res.msg,
      //         type: "success"
      //       });
      //     }
      //   });
      // // 设置未成单：
      // let customerAssignConfigListB= [
      //   {
      //     name: "BC_NOT_SIGN_RETURN_SEA_CYCLE_FROM_HQ",
      //     value: this.single_shard
      //   }
      // ];
      // this.$api.student
      //   .strategyConfigSetConfig({
      //     customerAssignConfigList: customerAssignConfigListB,
      //     type: 1
      //   })
      //   .then(res => {
      //     if (res.result == 2) {
      //       this.$message({
      //         message: res.msg,
      //         type: "error"
      //       });
      //     } else {
      //       this.$message({
      //         message: res.msg,
      //         type: "success"
      //       });
      //     }
      //   });
      // 设置OEM未跟进：
      // let customerAssignConfigListC = [
      //   {
      //     name: "BC_NOT_TRACKING_RETURN_SEA_CYCLE_FROM_OEM",
      //     value: this.OEMdeletedIds
      //   }
      // ];
      // this.$api.student
      //   .strategyConfigSetConfig({
      //     customerAssignConfigList: customerAssignConfigListC,
      //     type: 1
      //   })
      //   .then(res => {
      //     if (res.result == 2) {
      //       this.$message({
      //         message: res.msg,
      //         type: "error"
      //       });
      //     } else {
      //       this.$message({
      //         message: res.msg,
      //         type: "success"
      //       });
      //     }
      //   });
      // 设置oem未成单：
      // let customerAssignConfigListD = [
      //   {
      //     name: "BC_NOT_SIGN_RETURN_SEA_CYCLE_FROM_OEM",
      //     value: this.OEMsingle_shard
      //   }
      // ];
      // this.$api.student
      //   .strategyConfigSetConfig({
      //     customerAssignConfigList: customerAssignConfigListD,
      //     type: 1
      //   })
      //   .then(res => {
      //     if (res.result == 2) {
      //       this.$message({
      //         message: res.msg,
      //         type: "error"
      //       });
      //     } else {
      //       this.$message({
      //         message: res.msg,
      //         type: "success"
      //       });
      //     }
      //   });
      // 提交A类用户
      let customerAssignConfigListCA = [
        {
          name: "HQ_A_BC_CUSTOMER_AUTOWARE_RETURN_SEA_CYCLE",
          value: this.aUser
        }
      ];
      // 提交B类用户
      let customerAssignConfigListCB = [
        {
          name: "HQ_B_BC_CUSTOMER_AUTOWARE_RETURN_SEA_CYCLE",
          value: this.bUser
        }
      ];
      // 提交B-类用户
      let customerAssignConfigListCB2 = [
        {
          name: "HQ_B2_BC_CUSTOMER_AUTOWARE_RETURN_SEA_CYCLE",
          value: this.b2User
        }
      ];
      // 提交C类用户
      let customerAssignConfigListCC = [
        {
          name: "HQ_C_BC_CUSTOMER_AUTOWARE_RETURN_SEA_CYCLE",
          value: this.cUser
        }
      ];
      // 提交D类用户
      let customerAssignConfigListCD = [
        {
          name: "HQ_D_BC_CUSTOMER_AUTOWARE_RETURN_SEA_CYCLE",
          value: this.dUser
        }
      ];
      // 提交一个后台要求的接口数据
      let customerAssignConfigListCF = [
        {
          name: "HQ_F_BC_CUSTOMER_AUTOWARE_RETURN_SEA_CYCLE",
          value:20
        }
      ];
      if (this.auto == 1) {
        this.$api.student
          .strategyConfigSetConfig({
            customerAssignConfigList: customerAssignConfigListCA,
            type: 1
          })
          .then(res => {
            if (res.result == 2) {
              this.$message({
                message: res.msg,
                type: "error"
              });
            } else {
              this.$message({
                message: res.msg,
                type: "success"
              });
            }
          });
        this.$api.student
          .strategyConfigSetConfig({
            customerAssignConfigList: customerAssignConfigListCB,
            type: 1
          })
          .then(res => {
            if (res.result == 2) {
              this.$message({
                message: res.msg,
                type: "error"
              });
            } else {
              this.$message({
                message: res.msg,
                type: "success"
              });
            }
          });
        this.$api.student
          .strategyConfigSetConfig({
            customerAssignConfigList: customerAssignConfigListCB2,
            type: 1
          })
          .then(res => {
            if (res.result == 2) {
              this.$message({
                message: res.msg,
                type: "error"
              });
            } else {
              this.$message({
                message: res.msg,
                type: "success"
              });
            }
          });
        this.$api.student
          .strategyConfigSetConfig({
            customerAssignConfigList: customerAssignConfigListCC,
            type: 1
          })
          .then(res => {
            if (res.result == 2) {
              this.$message({
                message: res.msg,
                type: "error"
              });
            } else {
              this.$message({
                message: res.msg,
                type: "success"
              });
            }
          });
        this.$api.student
          .strategyConfigSetConfig({
            customerAssignConfigList: customerAssignConfigListCD,
            type: 1
          })
          .then(res => {
            if (res.result == 2) {
              this.$message({
                message: res.msg,
                type: "error"
              });
            } else {
              this.$message({
                message: res.msg,
                type: "success"
              });
            }
          });
        this.$api.student
          .strategyConfigSetConfig({
            customerAssignConfigList: customerAssignConfigListCF,
            type: 1
          })
          .then(res => {
            if (res.result == 2) {
              this.$message({
                message: res.msg,
                type: "error"
              });
            } else {
              this.$message({
                message: res.msg,
                type: "success"
              });
            }
          });  
      }
    },
    //  保存
    saveOEM() {
      let aa = [];
      let customerAssignConfigList = Object.assign({}, this.OEM);
      aa.push(customerAssignConfigList);
      aa.forEach(item => {
        item.value = item[0];
        item.name = "BC_AUTOWARE_RETURN_SEA_FROM_OEM";
      });
      this.$api.student
        .strategyConfigSetConfig({
          customerAssignConfigList: aa,
          type: 1
        })
        .then(res => {
          if (res.result == 2) {
            this.$message({
              message: res.msg,
              type: "error"
            });
          } else {
            this.$message({
              message: res.msg,
              type: "success"
            });
          }
        });
      // 设置OEM未跟进：
      let customerAssignConfigListC = [
        {
          name: "BC_NOT_TRACKING_RETURN_SEA_CYCLE_FROM_OEM",
          value: this.OEMdeletedIds
        }
      ];
      this.$api.student
        .strategyConfigSetConfig({
          customerAssignConfigList: customerAssignConfigListC,
          type: 1
        })
        .then(res => {
          if (res.result == 2) {
            this.$message({
              message: res.msg,
              type: "error"
            });
          } else {
            this.$message({
              message: res.msg,
              type: "success"
            });
          }
        });
      // 提交OEM卡A类用户
      let customerAssignConfigListOEMA = [
        {
          name: "BC_NOT_TRACKING_RETURN_SEA_CYCLE_FROM_OEM_A",
          value: this.OEMaUser
        }
      ];
      this.$api.student
        .strategyConfigSetConfig({
          customerAssignConfigList: customerAssignConfigListOEMA,
          type: 1
        })
        .then(res => {
          if (res.result == 2) {
            this.$message({
              message: res.msg,
              type: "error"
            });
          } else {
            this.$message({
              message: res.msg,
              type: "success"
            });
          }
        });
        // 提交OEM卡B类用户
      let customerAssignConfigListOEMB = [
        {
          name: "BC_NOT_TRACKING_RETURN_SEA_CYCLE_FROM_OEM_B",
          value: this.OEMbUser
        }
      ];
      this.$api.student
        .strategyConfigSetConfig({
          customerAssignConfigList: customerAssignConfigListOEMB,
          type: 1
        })
        .then(res => {
          if (res.result == 2) {
            this.$message({
              message: res.msg,
              type: "error"
            });
          } else {
            this.$message({
              message: res.msg,
              type: "success"
            });
          }
        });
        // 提交OEM卡B-类用户
      let customerAssignConfigListOEMB2 = [
        {
          name: "BC_NOT_TRACKING_RETURN_SEA_CYCLE_FROM_OEM_B2",
          value: this.OEMb2User
        }
      ];
      this.$api.student
        .strategyConfigSetConfig({
          customerAssignConfigList: customerAssignConfigListOEMB2,
          type: 1
        })
        .then(res => {
          if (res.result == 2) {
            this.$message({
              message: res.msg,
              type: "error"
            });
          } else {
            this.$message({
              message: res.msg,
              type: "success"
            });
          }
        });
        // 提交OEM卡c类用户
      let customerAssignConfigListOEMC = [
        {
          name: "BC_NOT_TRACKING_RETURN_SEA_CYCLE_FROM_OEM_C",
          value: this.OEMcUser
        }
      ];
      this.$api.student
        .strategyConfigSetConfig({
          customerAssignConfigList: customerAssignConfigListOEMC,
          type: 1
        })
        .then(res => {
          if (res.result == 2) {
            this.$message({
              message: res.msg,
              type: "error"
            });
          } else {
            this.$message({
              message: res.msg,
              type: "success"
            });
          }
        });
        // 提交OEM卡D类用户
      let customerAssignConfigListOEMD = [
        {
          name: "BC_NOT_TRACKING_RETURN_SEA_CYCLE_FROM_OEM_D",
          value: this.OEMdUser
        }
      ];
      this.$api.student
        .strategyConfigSetConfig({
          customerAssignConfigList: customerAssignConfigListOEMD,
          type: 1
        })
        .then(res => {
          if (res.result == 2) {
            this.$message({
              message: res.msg,
              type: "error"
            });
          } else {
            this.$message({
              message: res.msg,
              type: "success"
            });
          }
        });
      // 提交一个后台要求的接口数据
      let customerAssignConfigListOEMF = [
        {
          name: "BC_NOT_TRACKING_RETURN_SEA_CYCLE_FROM_OEM_F",
          value:20
        }
      ];
      this.$api.student
        .strategyConfigSetConfig({
          customerAssignConfigList: customerAssignConfigListOEMF,
          type: 1
        })
        .then(res => {
          if (res.result == 2) {
            this.$message({
              message: res.msg,
              type: "error"
            });
          } else {
            this.$message({
              message: res.msg,
              type: "success"
            });
          }
        });
    },
    generateRoute() {
      if (this.$route.name) {
        return this.$route;
      }
      return false;
    },
    isActive(route) {
      return route.path === this.$route.path;
    },
    closeSelectedTag(view) {
      this.$store.dispatch("delVisitedViews", this.$route).then(views => {
        if (this.isActive(this.$route)) {
          const latestView = views.slice(-1)[0];
          if (latestView) {
            this.$router.push(latestView);
          } else {
            this.$router.push("/");
          }
        }
      });
    }
  },
  mounted() {
    this.getConfig();
  }
};
</script>

<style lang="scss">
.el-table {
  display: block;
}
.has-gutter tr th {
  text-align: center;
}
.el-table__row td > .cell {
  text-align: center;
}
</style>
<style lang="scss" scoped>
.box {
  margin-left: 3% !important;
}
.input-box {
  margin-top: 2%;
  margin: 0 auto;
  .tit {
    display: inline-block;
    font-size: 20px;
    font-weight: 700;
  }
  .input-box-c .el-row {
    margin-top: 20px;
  }
}
.container .el-radio-group .el-radio:first-child {
  display: inline-block;
}
.el-row .el-col {
  margin-left: 0;
}
</style>
